-
Notifications
You must be signed in to change notification settings - Fork 505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat:add tls support fot memcached #5471
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you like to add a test for memcached with tls enabled?
No problem, I will complete it later. |
Does the Memcached service require any special configuration? During testing, I found many incorrect test results, and some tests occasionally pass while failing at other times during repeated tests. @Xuanwo
|
@@ -126,6 +148,22 @@ impl Builder for MemcachedBuilder { | |||
.with_context("endpoint", &endpoint), | |||
); | |||
}; | |||
if self.config.enable_tls { | |||
rustls::crypto::aws_lc_rs::default_provider() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit concerned about this. I don't want to make decisions for users when it comes to choosing a crypto provider. Let's use ring as default for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding a new boolean field? If the user selects true, they will need to provide it themselves.
let mut root_cert_store = rustls::RootCertStore::empty(); | ||
|
||
let native_certs = rustls_native_certs::load_native_certs(); | ||
if native_certs.errors.is_empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't care about those errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean just use .expect()
or .unwrap()
?
Which issue does this PR close?
Closes #5419.
Rationale for this change
see #5419
What changes are included in this PR?
Modified the
opendal::services::Memcached
to support TLS connections.Are there any user-facing changes?
Users can enable TLS using
.tls()
and provide the CA file using.cafile().
example: